package com.gk.carshopsys.dao;

import com.gk.carshopsys.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CarConfigMapper {

    @Select("SELECT * FROM car_series")
    List<CarSeries> findAllSeries();

    @Select("SELECT * FROM car_model WHERE series_id = #{seriesId}")
    List<CarModel> findModelsBySeries(Integer seriesId);

    @Select("SELECT * FROM car_color WHERE series_id = #{seriesId}")
    List<CarColor> findColorsBySeries(Integer seriesId);

    @Select("SELECT * FROM car_interior WHERE series_id = #{seriesId}")
    List<CarInterior> findInteriorsBySeries(Integer seriesId);

    @Select("SELECT * FROM car_option WHERE series_id = #{seriesId}")
    List<CarOption> findOptionsBySeries(Integer seriesId);
}